#include<iostream>
#include"string.h"
using namespace std;

void test_string1()
{
	lzz::string s1("hello world");
	lzz::string s2(10, 'z');
	s1.reserve(20);
	lzz::string s3;
	s3.push_back('1');
	s3.push_back('1');
	s3.push_back('1');
	s3.push_back('1');
	s3.push_back('1');
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;
	cout << s3.c_str() << endl;
}

void test_string2()
{
	lzz::string s1("hello");
	s1.append(" world");
	lzz::string s3;
	s3 = s1;
	cout << s1.c_str() << endl;
	cout << s3.c_str() << endl;
}

void test_string3()
{
	const lzz::string s3("ni");
	cout << s3.size() << endl;
	lzz::string s1("hello");
	s1 += '\0';
	s1 += "world";
	cin >> s1;
	cout << s1 << endl;
}

void test_string4()
{
	lzz::string s1("hello");
	s1.resize(10, 'x');
	s1[8]++;
	cout << s1 << endl;
}

void test_string5()
{
	lzz::string s1("helloxxxxx");
	lzz::string s2("helloxxxx");
	cout << (s1 == s2) << endl;
	size_t pos = s1.find('e');
	pos = s1.find("llo",1);
	cout << pos << endl;
	s1.insert(s1.size(), 'e');
	s1.insert(0, "nihao ");
	s1.insert(s1.size(), " shijie");
	s1.insert(6, " lzz ");
	cout << s1 << endl;
}

void test_string6()
{
	lzz::string s1("hello world");
	s1.erase(3, 6);
	cout << s1 << endl;
}

lzz::string func()
{
	lzz::string tmp("xxbbbbbbbbbb");
	return tmp;
}

void test_string7()
{
	lzz::string s1 = func();
	lzz::string s;
	s = func();
	return;
}

int main()
{
	test_string7();
	return 0;
}